//
//  CollectionHeadV.m
//  FKGW
//
//  Created by song ce on 2017/2/24.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "CollectionHeadV.h"
#import "OSSHelper.h"
@implementation CollectionHeadV

- (void)awakeFromNib {
    [super awakeFromNib];
 
}

-(void)setGroup:(MoreGroup *)group{
    _group = group;
    if(_group.ishaveIcon){
        self.noIconLabel.hidden = YES;
        self.nameLabel.hidden = NO;
        self.iconImageV.hidden = NO;
         self.nameLabel.text = _group.tradeName;
        
        //加载图片
        [[OSSHelper sharedHelper]OSSDownLoadWithObjectKey:_group.url xOssProcess:[NSString stringWithFormat:@"image/resize,m_lfit,w_%d,h_%d",18,18]  downLoadBlock:^(NSData *data) {
            dispatch_async(dispatch_get_main_queue(), ^{
                self.iconImageV.image= [UIImage imageWithData:data];
            });
        }];

    }else{
        self.noIconLabel.hidden = NO;
        self.nameLabel.hidden = YES;
        self.iconImageV.hidden = YES;
        self.noIconLabel.text = _group.tradeName;
    }
}

@end
